<template>
  <div>
    <h1>我是didi</h1>
    {{ count }}
 
  </div>
</template>

<script>

export default {
  name: "Didi",
  data() {
    return {
      //一般我们再接收发布信息之前，都要书写一个初始值
      count: 0,

    };
  },
  //先订阅，一般再初始化环节就订阅 mounted
  mounted() {
   this.$bus.$on("count", (count) => {
      this.count = count;
    });
  },
 
};
</script>

<style>
</style>